<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
/* GitHub stylesheet for MarkdownPad */
/* Author: Nicolas Hery - http://nicolashery.com */
/* Version: d5e7ce436666e7d4a2eeb12e7f8261dacceb3565 */
/* Source: https://github.com/nicolahery/markdownpad-github */

/* RESET
=============================================================================*/

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
}

/* BODY
=============================================================================*/

body {
  font-family: SimSun, Helvetica, arial, freesans, clean, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

body>*:first-child {
  margin-top: 0 !important;
}

body>*:last-child {
  margin-bottom: 0 !important;
}

/* BLOCKS
=============================================================================*/

p, blockquote, ul, ol, dl, table, pre {
  margin: 15px 0;
}

/* HEADERS
=============================================================================*/

h1, h2, h3, h4, h5, h6 {
  margin: 20px 0 10px;
  padding: 0;
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
  font-size: inherit;
}

h1 {
  font-size: 28px;
  color: #000;
}

h2 {
  font-size: 24px;
  border-bottom: 1px solid #ccc;
  color: #000;
}

h3 {
  font-size: 18px;
}

h4 {
  font-size: 16px;
}

h5 {
  font-size: 14px;
}

h6 {
  color: #777;
  font-size: 14px;
}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
  margin-top: 0;
  padding-top: 0;
}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
  margin-top: 0;
  padding-top: 0;
}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
  margin-top: 10px;
}

/* LINKS
=============================================================================*/

a {
  color: #4183C4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* LISTS
=============================================================================*/

ul, ol {
  padding-left: 30px;
}

ul li > :first-child, 
ol li > :first-child, 
ul li ul:first-of-type, 
ol li ol:first-of-type, 
ul li ol:first-of-type, 
ol li ul:first-of-type {
  margin-top: 0px;
}

ul ul, ul ol, ol ol, ol ul {
  margin-bottom: 0;
}

dl {
  padding: 0;
}

dl dt {
  font-size: 14px;
  font-weight: bold;
  font-style: italic;
  padding: 0;
  margin: 15px 0 5px;
}

dl dt:first-child {
  padding: 0;
}

dl dt>:first-child {
  margin-top: 0px;
}

dl dt>:last-child {
  margin-bottom: 0px;
}

dl dd {
  margin: 0 0 15px;
  padding: 0 15px;
}

dl dd>:first-child {
  margin-top: 0px;
}

dl dd>:last-child {
  margin-bottom: 0px;
}

/* CODE
=============================================================================*/

pre, code, tt {
  font-size: 12px;
  font-family: Consolas, "Liberation Mono", Courier, monospace;
}

code, tt {
  margin: 0 0px;
  padding: 0px 0px;
  white-space: nowrap;
  border: 1px solid #eaeaea;
  background-color: #f8f8f8;
  border-radius: 3px;
}

pre>code {
  margin: 0;
  padding: 0;
  white-space: pre;
  border: none;
  background: transparent;
}

pre {
  background-color: #f8f8f8;
  border: 1px solid #ccc;
  font-size: 13px;
  line-height: 19px;
  overflow: auto;
  padding: 6px 10px;
  border-radius: 3px;
}

pre code, pre tt {
  background-color: transparent;
  border: none;
}

/* QUOTES
=============================================================================*/

blockquote {
  border-left: 4px solid #DDD;
  padding: 0 15px;
  color: #777;
}

blockquote>:first-child {
  margin-top: 0px;
}

blockquote>:last-child {
  margin-bottom: 0px;
}

/* HORIZONTAL RULES
=============================================================================*/

hr {
  clear: both;
  margin: 15px 0;
  height: 0px;
  overflow: hidden;
  border: none;
  background: transparent;
  border-bottom: 4px solid #ddd;
  padding: 0;
}

/* TABLES
=============================================================================*/

table th {
  font-weight: bold;
}

table th, table td {
  border: 1px solid #ccc;
  padding: 6px 13px;
}

table tr {
  border-top: 1px solid #ccc;
  background-color: #fff;
}

table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

/* IMAGES
=============================================================================*/

.markdown-body img {
  max-width: 100%
}
</style>

</head>
<body>
<h2>历史，动机(motivation)</h2>
<a href="#key">目录</a>
<p>Argo起源与<a href="http://www.58.com/">58同城</a>的内部web框架wf(web framework)。</p>
<p>目前wf支撑着<a href="http://www.58.com/">58同城</a>几乎所有的web站点，包括wap和手机端的访问等，现在wf每天处理10亿级的请求。经过长时间的运作与运行，证明wf是一个可靠的、高效的web框架。</p>
<p>作为一个有一定规模的互联网企业，如果在变化的互联网环境中上线一个项目，在软件开发中需要在三方面进行平衡：</p>
<ol>
<li>组织/公司，在一个组织内部，需要每个项目开发尽量有统一的风格、架构，学习成本、维护成本等尽可能低；</li>
<li>运维，希望每个站点的配置和可执行部分分离，部署的方式相同；</li>
<li>项目内部，希望程序员聚焦在业务上，可以快速实现产品需求、响应产品变化。
在此基础上，我们开发了wf。</li>
</ol>
<p>Argo在wf做了大量优化和重构，以适应各组织软件开发的个性化需求，提升了系统性能，具有更好的可扩展性。Argo的开源反过来也促进wf2.0的开发。</p>
<h2>哲学观 (philosophy)</h2>
<ol>
<li><a href="http://zh.wikipedia.org/wiki/%E7%BA%A6%E5%AE%9A%E4%BC%98%E4%BA%8E%E9%85%8D%E7%BD%AE">约定优于配置</a>，减少软件开发人员需做决定的数量，获得简单的好处，而又不失灵活性。Argo体系中有且只有一个组织级约定，规定包的命名，配置文件路径，日志文件路径等。组织的约定是不容侵犯，每个项目在组织级约定下工作。组织级约定建议以jar形式下发给各项目。</li>
<li>简单，Argo可以不需要任何配置文件，项目代码结构简单，易于维护。</li>
<li>纪律，包和类的命名都受组织级约定的控制，任何违反约定的行为可能导致系统无法正常运行。</li>
</ol>
<h2>系统特点 (features)</h2>
<ol>
<li>SEO友好的URL结构，Argo天然支持RESTful的url结构，并能自动匹配合适的参数；</li>
<li>零配置，甚至你不要web.xml就能在tomcat上运行；</li>
<li>插拔式组件架构，可以灵活扩张功能；</li>
<li>高安全性，提供集群模式下，避免ip欺骗等功能。</li>
</ol>
<h2>系统约定 (convention)</h2>
<p>Argo不是一个通用的web框架，一个问题解决方案可能有很多，但在Argo中只提供一种解决方案。Argo在以下约定中工作：</p>
<ol>
<li>servlet 3.0环境，主要针对Tomcat 7.x；</li>
<li>基于<a href="http://code.google.com/p/google-guice/">guice</a>的Ioc，组织和项目可以各提供一个module注入模块，而且module的命名必须符合约定；</li>
<li>maven依赖，项目的代码体系和maven默认代码体系一致，maven以插件提供开发过程中所需要的开发运行环境（<a href="http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin">jetty:run</a>或<a href="http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/run-mojo.html">tomcat7:run</a>）。</li>
</ol>
<h2>Hello World</h2>
<p>请参考例子 samples/hello-world</p>
<p><code>shell
mvn tomcat7:run</code></p>
<p>或者
<code>shell
mvn jetty:run</code></p>
<p>然后浏览</p>
<p>http://localhost/</p>
<h2>进阶</h2>
<p>TODO</p>
<h2>如何实现 (how)</h2>
<p>TODO</p>
<h2>更新日志</h2>
<h3>2013-03-21</h3>
<a name="key"></a>
<ol>
<li>修正 issues #1, #2,</li>
<li>修正 ContextPath不是根目录(&quot;/&quot;)下无法正常运行的bug</li>
<li>提供model中默认参数 __beat,便于在view中使用</li>
<li>提供war:war打包plugin实例，移除web.xml的依赖</li>
</ol>
<p>```xml</p>
<p><plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </configuration>
</plugin></p>
<p>```</p>

</body>
</html>
<!-- This document was created with MarkdownPad, the Markdown editor for Windows (http://markdownpad.com) -->
